1. Field of the Invention
The present invention relates to an image conversion apparatus having an interpolation function which is performed during image conversion in which, for example, an enlarged or reduced image is prepared from image data obtained by reading an original image by using a line CCD scanner or the like, and also relates to an image conversion method and a recording medium on which procedures of image conversion are recorded.
2. Description of the Related Art
There have conventionally been proposed various methods as an interpolation calculation method in which interpolation calculation for image data is performed. Generally, a method based on a cubic spline interpolation function is used often. In this method, original image data {ZK} obtained by reading an original image is linked together by a cubic function {fK} at each section, and a value of fK at a position where an interpolated point is set (that is, a set position in the above-described section) is determined as interpolated image data.
The interpolation calculation which interpolates image data of an original image is a method of interpolation having a relatively high sharpness. For example, a cubic spline interpolation calculation is known as such a method.
In the cubic spline interpolation calculation, image data of continuous pixels Xk−2, Xk−1, Xk, Xk+1, Xk+2, . . . , which are obtained by digital reading, are indicated as Zk−2, Zk−1, Zk, Zk+1, Zk+2, . . . , respectively. Here, a spline interpolation function is set for each of sections, Xk−2Xk−1, Xk−1Xk, XkXk+1, and Xk+1Xk+2, and the spline interpolation functions corresponding to these sections are indicated as fk−2, fk−1, fk, fk+1, fk+2, . . . , respectively. Each interpolation function is a cubic function in which a position of the section is set as a variable.
Here, there will be described a case in which a point to be interpolated (hereinafter referred to as an interpolated point) is in a range of the section XkXk+1. The spline interpolation function corresponding to the section XkXk+1 is given by the following expression (1).fk(x)=Akx3+Bkx2+Ckx+Dk  (1)fk(X)=Zk  (2)fk(Xk+1)=Zk+1  (3)f′k(Xk)=f′k−1(Xk)  (4)f′k(Xk+1)=f′k+1(Xk+1)  (5)
In the aforementioned expressions, f′ indicates a first-order differentiation of function f, i.e., (3Akx2+2Bkx+Ck).
Strictly speaking, the cubic spline interpolation calculation also includes a condition of continuity of a second-order differential coefficient of function f, but if so, the computation formula becomes complicated. Accordingly, a simplified form of interpolation calculation such as that described above is generally used.
Further, in the cubic spline interpolation calculation, there is the condition that a first-order differential coefficient at a pixel XK coincides with the slope (Zk+1−Zk−1)/(Xk+1−Xk−1) of image data Zk−1 and Zk+1 of the pixels Xk−1 and Xk+1, which pixels are the pixels before and after the pixel Xk. Accordingly, the following expression (6) must be established.f′k(Xk)=(Zk+1−Zk−1)/(Xk+1−Xk−1)  (6)
Similarly, in the cubic spline interpolation calculation, there is the condition that a first-order differential coefficient at a pixel XK+1 coincides with the slope (Zk+2−Zk)/(Xk+2−Xk) of image data Zk and Zk+2 of the pixels Xk and Xk+2, which are the pixels before and after the pixel Xk+1. Accordingly, the following expression (7) must be established.f′k(Xk+1)=(Zk+2−Zk)/(Xk+2−Xk)  (7)
Here, assuming that an interval (that is, a grid interval) of each of the sections, Xk−2Xk−1, Xk−1Xk, XkXk+1, and Xk+1Xk+2, is set to be 1 and a position of an interpolated point Xp from the pixel Xk to the pixel Xk+1 is indicated as t (0≦t≦1), the following expressions are derived from the expressions (1) to (7).fk(0)=Dk=Zk fk(1)=Ak+Bk+Ck+Dk=Zk+1 f′k(0)=Ck=(Zk+1−Zk−1)/2f′k(1)=3Ak+2Bk+Ck=(Zk+2−Zk)/2Accordingly, Ak, Bk, Ck, and Dk are expressed as described below.Ak=(Zk+2−3Zk+1+3Zk−Zk−1)/2Bk=(−Zk+2+4Zk+1−5Zk+1+2Zk−1)/2Ck=(Zk+1−Zk−1)/2Dk=Zk 
The spline interpolation function fk(x) makes a change of variable of X=t as described above, and therefore, the following relation is established:fk(X)=fk(t)Accordingly, interpolated image data Zp at the interpolated point Xp is as follows:Zp=fk(t)=Akt3+Bkt2+Ckt+Dk  (8)Zp=((−t3+2t2−t)/2)Zk−1+((3t3−5t2+2)/2)Zk+((−3t3+4t2+t)/2)Zk+1+((t3−t2)/2)Zk+2  (9)
Respective coefficients of original image data Zk−1, Zk, and Zk+1 are referred to as interpolation coefficients ck−1(t), ck(t), ck+1(t), and ck+2(t), respectively. Namely, the interpolation coefficients ck−1(t), ck(t), ck+1(t), and ck+2(t) corresponding to the original image data Zk−1, Zk, and Zk+1 in expression (9) are as follows.ck−1(t)=(−t3+2t2−t)/2ck(t)=(3t3−5t2+2)/2ck+1(t)=(−3t3+4t2+t)/2ck+2(t)=(t3−t2)/2
By repeating the above-described calculations for each of the sections XkXk−1, Xk−1Xk, XkXk+1, and Xk+1Xk+2, interpolated image data whose intervals are different from those of the original image data can be obtained for the whole of the original image data.
In other words, as can be seen from expression (9), the cubic spline interpolation calculation allows calculation of an interpolated point by weighted averaging of the peripheral four points.
However, when interpolation is carried out by weighted averaging of the pixel values of an original image as described above, use of many pixels of an original image for the weighted averaging is contemplated so as to improve the image quality. In this case, a corresponding amount of calculation processing time for this operation is inevitably required.